﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Master/List.Master" AutoEventWireup="true" CodeBehind="RoleList.aspx.cs" Inherits="DevFx.Web.Pages.Rights.RoleList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHeader" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            gridview("<%=gvList.ClientID %>");
            $("#<%=gvList.ClientID %>").mouseover(function () {
                $(this).css("cursor", "hand");
            });
        });
        function show(id, flag) {
            return showWin("RoleEdit.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 600, 350);
        }
        function showRole(id, flag) {
            showWin("RoleUser.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 600, 350);
            return false;
        }
        function showMenu(id, flag) {
            showWin("RoleMenuList.aspx?time=" + new Date() + "&&id=" + id + "&&flag=" + flag, 800, 600);
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div  class="top">
    <asp:Button  runat="server" ID="btnadd"   CssClass="button2" Text=" 添 加 "  
        OnClientClick="return show('','1');" onclick="btnadd_Click"/>
    <asp:Button  runat="server" ID="btndel" Text=" 禁 用 " CssClass="button2" onclick="btndel_Click"  OnClientClick='return DisabledCount("<%=gvList.ClientID %>");'/>
    <asp:Button  runat="server" ID="btnEnabld" Text=" 启 用 " CssClass="button2" onclick="btnEnabld_Click"  OnClientClick='return abledCount("<%=gvList.ClientID %>");'/>
</div>
    <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" 
        CssClass="gv" AllowSorting="True"
        BorderStyle="None" onsorting="gvList_Sorting" 
        onrowcommand="gvList_RowCommand">
        <Columns>
             <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="cbx1" runat="server" />
                </ItemTemplate>
                <HeaderTemplate>
                    <asp:CheckBox ID="cbx1" runat="server" />
                </HeaderTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="RoleName" HeaderText="角色名称" SortExpression="RoleName" />
             <asp:TemplateField HeaderText="状态" SortExpression="Disabled">
                 <ItemTemplate>
                     <%#Eval("Disabled").ToString().ToLower()=="true"?"禁用":"启用"%>
                 </ItemTemplate>
             </asp:TemplateField>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <img  src="../../Contents/images/edit.gif" height="13" width="13"/>
                    <asp:LinkButton runat="server"  ID="btnlink"  OnClientClick='<%# " return show(\"" + Eval("RoleID").ToString() + "\",2);" %>' Text="编辑" CommandName="editing"></asp:LinkButton>
                    <asp:LinkButton runat="server" ID="btnuserEdit" OnClientClick='<%# " return showRole(\"" + Eval("RoleID").ToString() + "\",2);" %>' CommandName="role"
                        Text="人员维护"></asp:LinkButton>
                        <asp:LinkButton runat="server" ID="LinkButton1" OnClientClick='<%# " return showMenu(\"" + Eval("RoleID").ToString() + "\",2);" %>' CommandName="role"
                        Text="菜单维护"></asp:LinkButton>
                    <asp:HiddenField  runat="server" ID="hfID" Value='<%#Eval("RoleID") %>'/>

                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
   
</asp:Content>
